package com.acme;

import java.util.EnumSet;

public class Player {

	public static enum STATUS {Active, Retired}
	public static enum POSITION {
        QB ("QB"), WR ("WR"), RB("RB"), FB("FB"), TE("TE"), OL("OL"), DL("DL"), LB("LB"), DB("DB"), K("K"), P("P"), ST("ST");
        private String value;

        POSITION(String value){
           this.value = value;
        }

        public String toString(){
            return value;
        }

        public static POSITION getByValue(String value){
            POSITION returnValue = null;
            for (final POSITION element : EnumSet.allOf(POSITION.class)) {
                if (element.toString().equals(value)) {
                    returnValue = element;
                }
            }
            return returnValue;
        }
	}
	private String name;
	private Player.STATUS status;
	private Player.POSITION position;
	private String team;
	private String school;
	
	public Player(){
		this.name = "";
		this.status = STATUS.Active;
		this.position = POSITION.QB;
		this.team = "";
		this.school = "";		
	}
	
	public Player(String name, Player.STATUS status, Player.POSITION position, String team, String school){
		this.name = name;
		this.status = status;
		this.position = position;
		this.team = team;
		this.school = school;
	}
	
	public Player(String name){
		this.name = name;
		this.status = STATUS.Active;
		this.position = POSITION.QB;
		this.team = "";
		this.school = "";	
	}
	
	public String toString(){
		return getStatusString()+" "+name+" "+getPosition().toString()+" "+team+" "+school;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Player.STATUS getStatus() {
		return status;
	}
	
	public String getStatusString(){
		if(status == STATUS.Active)
			return "A";
		else
			return "R";
	}

	public void setStatus(Player.STATUS status) {
		this.status = status;
	}

	public POSITION getPosition() {
		return position;
	}

	public void setPosition(POSITION position) {
		this.position = position;
	}

	public String getTeam() {
		return team;
	}

	public void setTeam(String team) {
		this.team = team;
	}

	public String getSchool() {
		return school;
	}

	public void setSchool(String school) {
		this.school = school;
	}
	
}
